﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using System.Management.Automation.Provider;


namespace SharePoint.Utilities.Cmdlets
{
    [Cmdlet("Import", "TermStore")]
    public class ImportTermStore : Cmdlet
    {

        [Parameter(Mandatory = true, HelpMessage = "Specify Source SiteCollection")]
        public string SourceSiteCollectionUrl { get; set; }

        [Parameter(Mandatory = true, HelpMessage = "Specify Destination SiteCollection")]
        public string DestinationSiteCollectionUrl { get; set; }


        [Parameter(Mandatory=false,HelpMessage ="Specify TermStore Name")]
        public string TermStoreName { get; set; }


        protected override void ProcessRecord()
        {
            this.WriteObject("Importing...");
            ImportTermStoreHelper.sourceEndPoint = SourceSiteCollectionUrl;
            ImportTermStoreHelper.destinationEndPoint = DestinationSiteCollectionUrl;
            ImportTermStoreHelper.termStoreName = TermStoreName;
            

            ImportTermStoreHelper.ImportTermStore();

            
        }
    }
}
